<div class="campaign-col-item buzzmetrend">
    <div class="comment-header">
        <span>NHỮNG THỐNG KÊ VỀ THƯƠNG HIỆU NÀY</span>
        <div class="dateRange btn selected">
            THỐNG KÊ
        </div>
        <div class="flatform btn">
            BÌNH LUẬN
        </div>
    </div>
    <div class="campaign-col-body">
        <div class="metrics-block-number" style="width: 205px">
            <h5>
                NUMBER OF REPLIES
                <a>
                    <i class="fa fa-question-circle"></i>
                </a>
            </h5>
            <div class="widget-counter-buzzmetrend">
                <div>
                    <span class="number">208</span>
                    <span class="text">threads</span>
                </div>
                <div>
                    <span class="number">1.2K</span>
                    <span class="text">replies</span>
                </div>
            </div>
        </div>
        <div class="metrics-block-graph">
            <h5>
                REPLIES TRENDLINE
                <a>
                    <i class="fa fa-question-circle"></i>
                </a>
            </h5>
            <div id="buzzmetrend">

            </div>
        </div>
        <div class="loading overlay-loader">
            <img class="loader-icon spinning-cog" src="<?php echo ROOT_URL; ?>public/load/cogs/cog16.svg" data-cog="cog16">
        </div>
    </div>
</div>

<div class="campaign-col-item social-network-type">
    <div class="metrics-block-number">
        <h5>
            SOCIAL NETWORK TYPE
            <a>
                <i class="fa fa-question-circle"></i>
            </a>
        </h5>
        <div id="social-network-type-pie"></div>
    </div>
    <div class="metrics-block-graph">
        <h5>
            TREND SOCIAL NETWORK TYPE
            <a>
                <i class="fa fa-question-circle"></i>
            </a>
        </h5>
        <div id="social-network-type-area"></div>
    </div>
    <div class="loading"></div>
</div>
<div class="campaign-col-item overall-rating">
    <div class="metrics-block-number">
        <h5>
            OVERALL RATING
            <a>
                <i class="fa fa-question-circle"></i>
            </a>
        </h5>
        <div class="overall-rate">
            <div class="overall-score">
                <span class="overall-score-avg">4,1</span>
                <span class="overall-score-star"></span>
                <span class="overall-score-user">Tổng số 12.809</span>
            </div>
            <div class="overall-rate-all">
                <div class="overall-rating-item">
                    <span class="overall-rating-star-icon"><i class="fa fa-star"></i></span>
                    <span class="overall-rating-star">5</span>
                    <div class="overall-rating-score">
                        <span class="rating-5" style="width: 100%">7.326</span>
                    </div>
                </div>
                <div class="overall-rating-item">
                    <span class="overall-rating-star-icon"><i class="fa fa-star"></i></span>
                    <span class="overall-rating-star">4</span>
                    <div class="overall-rating-score">
                        <span class="rating-4" style="width: 60%">3.326</span>
                    </div>
                </div>
                <div class="overall-rating-item">
                    <span class="overall-rating-star-icon"><i class="fa fa-star"></i></span>
                    <span class="overall-rating-star">3</span>
                    <div class="overall-rating-score">
                        <span class="rating-3" style="width: 40%">2.326</span>
                    </div>
                </div>
                <div class="overall-rating-item ">
                    <span class="overall-rating-star-icon"><i class="fa fa-star"></i></span>
                    <span class="overall-rating-star">2</span>
                    <div class="overall-rating-score">
                        <span class="rating-2" style="width: 20%">1.326</span>
                    </div>
                </div>
                <div class="overall-rating-item ">
                    <span class="overall-rating-star-icon"><i class="fa fa-star"></i></span>
                    <span class="overall-rating-star">1</span>
                    <div class="overall-rating-score">
                        <span class="rating-1" style="width: 10%">326</span>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="metrics-block-graph">
        <h5>
            RATING BY ATTRIBUTES
            <a>
                <i class="fa fa-question-circle"></i>
            </a>
        </h5>
        <div class="rating-attributes">
            <table>
                <tr class="rating-attribute-item">
                    <td>Giá</td>
                    <td><span class="rating-attribute-star"></span></td>
                </tr>
                <tr class="rating-attribute-item">
                    <td>Chất lượng</td>
                    <td><span class="rating-attribute-star"></span></td>
                </tr>
                <tr class="rating-attribute-item">
                    <td>Kiểu dáng</td>
                    <td><span class="rating-attribute-star"></span></td>
                </tr>
                <tr class="rating-attribute-item">
                    <td>Chức năng</td>
                    <td><span class="rating-attribute-star"></span></td>
                </tr>
            </table>
        </div>
    </div>
    <div class="loading"></div>
</div>

<div class="campaign-col-item demographic">
    <div class="metrics-block-number">
        <h5>
            DEMOGRAPHICS GENDER
            <a>
                <i class="fa fa-question-circle"></i>
            </a>
        </h5>
        <div class="demographic-gender">
            <div class="demographic-gender-icon">
                <div class="demographic-gender-sex">
                    <div class="male-icon"></div>
                    <div class="male percent">69%</div>
                </div>
                <div class="demographic-gender-sex">
                    <div class="female-icon"></div>
                    <div class="female percent">31%</div>
                </div>
            </div>
        </div>
    </div>
    <div class="metrics-block-graph">
        <h5>
            DEMOGRAPHICS AGE
            <a>
                <i class="fa fa-question-circle"></i>
            </a>
        </h5>
        <div class="demographic-gender-analytics">
            <table>
                <tr>
                    <td>18-20</td>
                    <td>
                        <div class="demographic-gender-progress">
                            <span style="width: 90%"></span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>21-24</td>
                    <td>
                        <div class="demographic-gender-progress">
                            <span style="width: 60%"></span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>25-34</td>
                    <td>
                        <div class="demographic-gender-progress">
                            <span style="width: 50%"></span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>35-44</td>
                    <td>
                        <div class="demographic-gender-progress">
                            <span style="width: 40%"></span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>45-54</td>
                    <td>
                        <div class="demographic-gender-progress">
                            <span style="width: 20%"></span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>55-64</td>
                    <td>
                        <div class="demographic-gender-progress">
                            <span style="width: 10%"></span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>65+</td>
                    <td>
                        <div class="demographic-gender-progress">
                            <span style="width: 0%"></span>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div class="loading"></div>
</div>
<div class="campaign-col-item demographic">
    <div class="metrics-block-number">
        <h5>
            DEMOGRAPHICS LOCATION
            <a>
                <i class="fa fa-question-circle"></i>
            </a>
        </h5>
        <div class="demographic-location">
            <div class="demographic-location-analytics">
                <table class="table">
                    <tr>
                        <td>1</td>
                        <td>TP HCM</td>
                        <td>4000</td>
                        <td>30%</td>
                    </tr>
                    <tr>
                        <td>2</td>
                        <td>Hà Nội</td>
                        <td>5000</td>
                        <td>40%</td>
                    </tr>
                    <tr>
                        <td>3</td>
                        <td>Hải Phòng</td>
                        <td>2000</td>
                        <td>20%</td>
                    </tr>
                    <tr>
                        <td>4</td>
                        <td>Đà Nẵng</td>
                        <td>1000</td>
                        <td>10%</td>
                    </tr>
                    <tr>
                        <td>5</td>
                        <td>Nha Trang</td>
                        <td>500</td>
                        <td>4%</td>
                    </tr>
                    <tr>
                        <td>5</td>
                        <td>Các tỉnh thành khác</td>
                        <td>300</td>
                        <td>3%</td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    <div class="metrics-block-graph">
        <h5>
            DEMOGRAPHICS LOCATION PIE
            <a>
                <i class="fa fa-question-circle"></i>
            </a>
        </h5>
        <div class="demographic-location-pie">
            <div id="demographic_location"></div>
        </div>
    </div>
    <div class="loading"></div>
</div>

<script>
    $(function(){

        $('.overall-score-star').jRating();

        $('.rating-attribute-star').jRating();

        $('#buzzmetrend').highcharts({
            chart:{
                height: 150
            },
            title: {
                text: '',
                x: -20 //center
            },
            subtitle: {
                text: '',
                x: -20
            },
            xAxis: {
                type: 'datetime',
                labels: {
                    align: 'center'
                }
            },
            yAxis: {
                title: {
                    text: ''
                },
                gridLineColor: 'transparent',
                plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#808080'
                }]
            },
            tooltip: {
                valueSuffix: ' mention'
            },
            legend: {
                layout: 'vertical',
                align: 'right',
                verticalAlign: 'middle',
                borderWidth: 0,
                enabled: false
            },
            series: [{
                name: '',
                data: [
                    [Date.UTC(2014, 3, 11),7.0],
                    [Date.UTC(2014, 3, 12),8.0],
                    [Date.UTC(2014, 3, 13),6.0],
                    [Date.UTC(2014, 3, 14),19.0]
                ],
                color: '#F9800C'
            }]
        });


        $('#social-network-type-pie').highcharts({
            chart: {
                type: 'pie',
                spacingBottom: 0,
                spacingTop: 0,
                spacingLeft: 0,
                spacingRight: 0,
                width: 400,
                height: 250,
                marginTop: 0,
                marginBottom: 0
            },
            title:{
                text: ''
            },
            plotOptions: {
                pie: {
                    allowPointSelect: true,
                    cursor: 'pointer',
                    dataLabels: {
                        enabled: true,
                        format: '<b>{point.name}</b>: {point.percentage:.1f} %'
                    },
                    borderWidth:0
                }
            },
            legend:{
                enable: false
            },
            tooltip: {
                headerFormat: '',
                pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}%</b><br/>'
            },
            series: [{
                colorByPoint: true,
                data: [
                    {
                        name: 'Firefox',
                        y: 45.0
                    },
                    ['Facebook',   33.0],
                    ['Google+',       32.3],
                    ['Twitter',    5.5]
                ]
            }]
        });

        $('#demographic_location').highcharts({
            chart: {
                type: 'pie',
                spacingBottom: 0,
                spacingTop: 0,
                spacingLeft: 0,
                spacingRight: 0,
                width: 400,
                height: 250,
                marginTop: 0,
                marginBottom: 0
            },
            title:{
                text: ''
            },
            plotOptions: {
                pie: {
                    allowPointSelect: true,
                    cursor: 'pointer',
                    dataLabels: {
                        enabled: true,
                        format: '<b>{point.name}</b>: {point.percentage:.1f} %'
                    },
                    borderWidth:0
                }
            },
            legend:{
                enable: false
            },
            tooltip: {
                headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
                pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}%</b> of total<br/>'
            },
            series: [{
                name: 'Brands',
                colorByPoint: true,
                data: [
                    ['TP HCM',   33.0],
                    ['Hà nội',       32.3],
                    ['Hải phòng',    5.5],
                    ['Đà nẵng',     9.2],
                    ['Nha trang',   1.2],
                    ['Các tỉnh thành khác',   2.4]
                ]
            }]
        });

        $('#social-network-type-area').highcharts({
            chart: {
                type: 'area',
                height: 250
            },
            title: {
                text: ''
            },
            subtitle: {
                text: ''
            },
            xAxis: {
                allowDecimals: false,
                labels: {
                    formatter: function () {
                        return this.value; // clean, unformatted number for year
                    }
                }
            },
            yAxis: {
                title: {
                    text: ''
                },
                gridLineColor: 'transparent',
                labels: {
                    formatter: function () {
                        return this.value / 1000 + 'k';
                    }
                }
            },
            tooltip: {
                pointFormat: '{series.name} produced <b>{point.y:,.0f}</b><br/>warheads in {point.x}'
            },
            plotOptions: {
                area: {
                    pointStart: 1940,
                    marker: {
                        enabled: false,
                        symbol: 'circle',
                        radius: 2,
                        states: {
                            hover: {
                                enabled: true
                            }
                        }
                    }
                },
                series: {
                    events: {
                        legendItemClick: function (event) {
                            var name = this.name;
                            var pie_chart = $('#social-network-type-pie').highcharts();
                            $(pie_chart.series).each(function(){
                                $(this.data).each(function(k,z){
                                    if(z.name == name){
                                        if(z.visible)
                                        {
                                            z.setVisible(false);
                                        }
                                        else
                                        {
                                            z.setVisible(true);
                                        }
                                    }
                                });
                            });
                        }
                    }
                }

            },
            series: [{
                id: "social_network_type",
                name: 'Facebook',
                data: [null, null, null, null, null, 6, 11, 32, 110, 235, 369, 640,
                    1005, 1436, 2063, 3057, 4618, 6444, 9822, 15468, 20434, 24126,
                    27387, 29459, 31056, 31982, 32040, 31233, 29224, 27342, 26662,
                    26956, 27912, 28999, 28965, 27826, 25579, 25722, 24826, 24605,
                    24304, 23464, 23708, 24099, 24357, 24237, 24401, 24344, 23586,
                    22380, 21004, 17287, 14747, 13076, 12555, 12144, 11009, 10950,
                    10871, 10824, 10577, 10527, 10475, 10421, 10358, 10295, 10104]
            }, {
                id: "social_network_type1",
                name: 'Google+',
                data: [null, null, null, null, null, null, null, null, null, null,
                    5, 25, 50, 120, 150, 200, 426, 660, 869, 1060, 1605, 2471, 3322,
                    4238, 5221, 6129, 7089, 8339, 9399, 10538, 11643, 13092, 14478,
                    15915, 17385, 19055, 21205, 23044, 25393, 27935, 30062, 32049,
                    33952, 35804, 37431, 39197, 45000, 43000, 41000, 39000, 37000,
                    35000, 33000, 31000, 29000, 27000, 25000, 24000, 23000, 22000,
                    21000, 20000, 19000, 18000, 18000, 17000, 16000]
            }]
        });

    });
</script>